home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
dev
/
amos
/
am_mui10.lha
/
MUI
/
MUI-DEMO.AMOS
/
MUI-DEMO.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1992-02-26
|
44KB
|
1,349 lines
'*****************************************************************************
'** AMOS MUI Demo V1.0 - By Paul Hickman (ph@doc.ic.ac.uk) **
'** ================== ================================= **
'** This file is both a demonstraction, and an application template. Read **
'** the comments on how & where to modify it. **
'** **
'** At least MUI V2.1 (muimaster.library V8) is required, and KS2.04+ **
'** **
'** MUI V2.1 is available on aminet as /dev/gui/mui21usr.lha. You should **
'** also get /dev/gui/mui21dev.lha to get the programers documentation & **
'** autodocs. You do not need the rest of the developers archive, apart **
'** from maybe the demo programs sources to look at examples of objects. **
'** **
'** This freeware. It may be freely distributed / modified as long as no **
'** profit is made, except as part of a shareware program, where you may **
'** use it if you send me a registered copy. **
'** **
'** Please send me any MUIB macro procedures you write that may be usefull, **
'** other improvements, ideas, and bug reports. **
'*****************************************************************************
'Rev 19
'
'NOTE: If you break an MUI program, or an error occurs, you should go to
'direct mode and type Areg(0)=APP_Obj : A=LibCall(2,-$24) immediately
'to remove the MUI windows & commodities brokers.
'
'
'NOTE: The symbolic names for MUI's constants have been taken from the MUI.I
' assembler include file, and in a few cases differ slightly from the
' C MUI.h file.
'
'
'Bank Usage
'==========
'
'
'13 - Symbol Table Weight Balenced (Almost) Binary Tree for MUI & ASL taglists
'14 - Generic Hook Code that calls _USER_RETURN_ID
'17 - MUI Permanent Workspace
'18 - MUI Temporary Workspace
'
'32 - Special Hook Code for LISTSTRING objects
'
Set Buffer 20
'
'
'********************
'** Debugging Mode **
'********************
'
'Since if errors occur in your initial objects taglists, you may have some
'objects already allocated, run with _DEBUG=1 initially, until you get the
'message 'Application Tested OK', then switch _DEBUG=0 to run for real. When
'_DEBUG=1, the no objects are actually created, so if something goes wrong,
'you don't have to manually dispose of anything.
_DEBUG=0
'
'****************************************************************************
'For Users of andrew chruches Intuition Extension, you can put MUI windows
'on an AMOS Intuition screen - uncomment this line, and those in the window
'definitions, and the Iscreen Close at the end.
'
'Iscreen Open 0,640,256,2,Hires,"MUI Demo Screen"
'
'
'
'MUI Initialisation
'==================
'
'Parameter 1 is size of bank 17 which is reserved for string gadget text,
'hook data structures, etc. You can find out how much has been used at
'any time by examining the value of MUI_WORK_PTR which points to it's end
'
'Parameter 2 is size of bank 18 which is used to store a taglist temporary
'literal strings.
'
_MUI_INIT[10000,2000]
'MUI Macros
'==========
'
'I Have not yet converted all MUI macros. Some simple ones appear here,
'others occur as procedures below.
Def Fn ADR$(A)="("+ Extension_16_04CE(A)+"),"
Def Fn MUI_CHILD$(OBJ)="MUIA_Group_Child,"+ Fn ADR$(OBJ)
Def Fn MUI_WIN_CONTENT$(OBJ)="MUIA_Window_RootObject,"+ Fn ADR$(OBJ)
Def Fn MUI_APP_WINDOW$(OBJ)="MUIA_Application_Window,"+ Fn ADR$(OBJ)
'****************************************************************************
'Insert initialisation of your programs arrays & variables here.
'****************************************************************************
'This part of the program creates the MUI Application interface.
'===============================================================
'Unlike most languages where you can create the application in one massive
'function call, in AMOS, you have to do it object by object from the bottom
'up - I.E. Before creating an object, you must have first created all of its
'children. (Children = Sub Objects / Other Objects which it contains a pointer
'to)
'NOTE: To ensure correct deallocation of memory, you should create each
' object, and totally ignore the return value. When you create an object
' if you set any of its children to 0 in the taglist, that object
' fails, and in doing so, disposes of any of its non-NULL children. When
' you create the application object, look at APP_OBJ. If it is 0, one of
' your objects failed to create, but everything else has been deallocated
' from memory. Do not stop as soon as you find a NULL return value.
'NOTE: Always call you application object APP_OBJ for consistancy.
'AMOS Taglist Format
'===================
'
'What is a taglist?
'------------------
'
'A Taglist is an set of consecutive pairs of longwords of memory, terminated
'by a NULL longword e.g.
'
' Ellong$(TAG1)+Ellong$(DATA1)+elong$(TAG2)+elong$(DATA2)+elong$(0)
'
'The first longword of each pair is called the 'Tag' and is usually a
'constant value from an include/header file (An equate in AMOS), which
'describes the attribute you wish to set. The 'Data' longword is the
'value you wish to set that attribute to. So if the AMOS Screen Open
'command took a taglist, it might be something like:
'
'Screen Open Ellong$(SCR_NUMBER)+Ellong$(0)
' +Ellong$(SCR_WIDTH)+Ellong$(320)
' +Ellong$(SCR_HEIGHT)+Ellong$(200)
' +Ellong$(SCR_MODE)+Ellong$(SCR_MODE_LOWRES)
' +Ellong$(SCR_COLOURS)+Ellong$(16)
' +Ellong$(0)
'
'The variables are the 'tag' constants. The tags are used so that the
'parameter can be given in any order, and some can be left out. Any that
'are left out are given default values.
'
'
'How does MUI use taglists?
'==========================
'
'MUI uses taglists to describe the intial attributes of the object which
'make up your interface, and to change these attributes. It also uses them
'in the _DO_METHOD function, but breaks the rules slightly here, as the
'tags aren't in pairs, and order is important.
'
'
'How do I make using taglists from AMOS Easier?
'==============================================
'
'The taglist should be placed in an AMOS string, with each item seperated
'by commas. Elements can be:
'
'
' - Decimal Numbers
'
' - Hex Numbers
'
' - Symbolic Names (Equates) from the assembler MUI.I file
'
' - Literal Strings, by placing them in single quotes. These strings
' as temporary, suitable for MUI_Text_Contents & Listview elements.
' They are overwritten by the next taglist's strings.
'
' - Permanent Literal Strings, by begining the quotes with a backward single
' quotes (` = Alt-'). These strings as copied into the MUI Workspace bank.
' E.g. "MUIA_Window_Title,`The Window'"
'
' - Longwords, by placing them in parenthesis (). These are longwords
' generated from integers with the Ellong$() function. Use for object
' addresses / values in AMOS integer variables, via the ADDR$ macro
'
'
'Literal Strings may contain (This may change in new versions):
'
' \n = Newline
' \a = '
' \b = `
' \q = "
' \t = Tab
' \e = Escape
' \\ = \
'
'See Mui Autodoc for for Text.mui for details of MUI text formatting strings
'
'Pass these taglists to _COMPILE, and a relocatable form of the taglist
'will be returned in Param$. This string could be saved in a bank, or
'wherever to remove the need for compiling it every time the program is
'run.
'
'
'General Use Of Strings
'======================
'
'
' If a string is to be displayed as text by MUI (E.g. Listviews, Labels,
' buttons, etc.) it is safe to make it a temporary string. If it is to
' be displayed by intuiton (E.g. Window Titles), make it permanent.
'
' There is no need to append chr$(0) to the end of your strings - my
' procedure do this when necessary.
'
' If you manual include a pointer to a string in a taglist, make sure
' that address will remain constant until the taglist is used, and if
' the string is not copied my MUI, and needs to be permanent, make sure
' the address does not change until the object is disposed of. This means
' do not use Varptr(...$) as the AMOS garbage collector may move it.
'
'
'Passing taglists to my MUI procedures
'=====================================
'
'The _COMPILE procedure replaces the symbolic names & hex/decimal integers
'with longwords, and moves the literal strings together at the end of the
'string. It stores offset information about the literal strings at the very
'end of the taglist.
'
'When you pass a taglist to a procedure, the address of the strings is
'computed, and inserted into the list, which is then passed to MUI. Also
'permanent strings are stored in bank 17
'
'You may also pass any function which expects a taglist a real raw taglist
'string (Array of longwords), on the condition that it does not end with
'the longword $80000000, as this is how compiled taglist are identified.
'If your raw taglist does end in $80000000, just add an Ellong$(0) to the
'end - this should not cause any problems.
'****************************************************************************
'Creation of the demo application.
'******* Creation of sounds window
'
'Create the sound / close button objects
'
_MUIB_KEYBUTTON["Quit","q"] : BUT_QUIT_OBJ=Param
_MUIB_KEYBUTTON["Bell","b"] : BUT_BELL_OBJ=Param
_MUIB_KEYBUTTON["Gun","g"] : BUT_SHOOT_OBJ=Param
_MUIB_KEYBUTTON["Explosion","e"] : BUT_BOOM_OBJ=Param
'Create the horizontal group for the buttons
'
_MUIB_GROUP[ Extension_16_04CE(BUT_BELL_OBJ)+ Extension_16_04CE(BUT_SHOOT_OBJ)+ Extension_16_04CE(BUT_BOOM_OBJ)+ Extension_16_04CE(BUT_QUIT_OBJ),1,0]
GRP2_OBJ=Param
'Create the title label boxes
'
_MUIB_TITLE_LABEL["Some MUI Gadgets"] : LAB_GAD_OBJ=Param
_MUIB_TITLE_LABEL["AMOS Sound Effects"] : LAB_SOUND_OBJ=Param
'Create the string gadget
'
_MUIB_FILESTRING["File:","f","Filename","Select Filename"] : FILE_OBJ=Param
'Create the popinglist-string gadget
'
_MUIB_LISTVIEW["Excellent|Super|Advanced|Default|Average|Crap|Useless|IBM"] : PLIST_OBJ=Param
_MUIB_LISTSTRING["Default",32,"c","Class:",PLIST_OBJ] : PLS_OBJ=Param
'Create the cycle gadget
'
_MUIB_CYCLE["This|Is|A|Cycle|Gadget"] : CYC_OBJ=Param
'Create the listview gadget
'
_MUIB_LISTVIEW["This|Is A|Simple|Listview|Gadget"] : LIST_OBJ=Param
'Create the bitmap from bob image.
'
_MUIB_BITMAP_BOB[1,"MUIV_FrameGroup"] : BIT_OBJ=Param
'Create the checkmark object
'
'
_MUIB_CHECKMARK["Checkmark","m",0] : CHK_OBJ=Param
'Put the bitmap, checkmark & cycle in a group.
'
_MUIB_GROUP[ Extension_16_04CE(CYC_OBJ)+ Extension_16_04CE(CHK_OBJ),0,1]
GRP3_OBJ=Param
_MUIB_GROUP[ Extension_16_04CE(BIT_OBJ)+ Extension_16_04CE(GRP3_OBJ),1,0]
GRP4_OBJ=Param
'Create the windows main group
'
_MUIB_GROUP[ Extension_16_04CE(LAB_GAD_OBJ)+ Extension_16_04CE(GRP4_OBJ)+ Extension_16_04CE(LIST_OBJ)+ Extension_16_04CE(FILE_OBJ)+ Extension_16_04CE(PLS_OBJ)+ Extension_16_04CE(LAB_SOUND_OBJ)+ Extension_16_04CE(GRP2_OBJ),0,0]
GRP1_OBJ=Param
'
'Create the window object
'
WIN$="MUIA_Window_Title,`MUI-AMOS Test Window',"
'
'Uncomment to put window on AMOS Intuition screen if you have that extension
'WIN$=WIN$+"MUIA_Window_Screen,"+ Fn ADR$( Iscreen Base )
WIN$=WIN$+ Fn MUI_WIN_CONTENT$(GRP1_OBJ)+"TAG_DONE"
_COMPILE[WIN$]
_MUI_NEW_OBJECT["Window.mui",Param$] : WIN_OBJ=Param
'********** Create the application object
'
'NOTE: All windows are children of the application object, but do not appear
' until the window open attribute is set.
'
'NOTE: The strings below appear in commodities exchange & CLI version command
' and should always be set.
'
APP$="MUIA_Application_Author,'Paul Hickman',"
APP$=APP$+"MUIA_Application_Base,'AMOS-MUI',"
APP$=APP$+"MUIA_Application_Title,'AMOS MUI Demo',"
APP$=APP$+"MUIA_Application_Version,'$VER: AMOS MUI Demo 1.0 (12.08.94)',"
APP$=APP$+"MUIA_Application_Copyright,'Paul Hickman 1994.',"
APP$=APP$+"MUIA_Application_Description,'Example on how to use MUI from AMOS',"
APP$=APP$+ Fn MUI_APP_WINDOW$(WIN_OBJ)+"TAG_DONE"
_COMPILE[APP$]
_MUI_NEW_OBJECT["Application.mui",Param$] : APP_OBJ=Param
If APP_OBJ=0
'Insert your emergency abort code here
If _DEBUG=1
Print "Application Tested OK."
Else
Print "Failed to create application."
End If
_MUI_CLOSE
End
Else
Print "Application Created."
End If
'****************************************************************************
'This part of the program initialises the methods. These are strings that
'say "Whenever this happens to object A, make this happen to object B", or
'"Whenever this happens to object A, call the _USER_RETURNID procedure with
'this parameter.
'
'
'NOTE: These methods can be initialised anytime after the objects they
' concern are created. Only those concerning APP_OBJ must wait until
' now. It is in fact better to put them before the APP_OBJ creation
' if possible so you can test them with _DEBUG=1.
'
'
'Setup the window close button to quit the program
'
'Parameters of taglist are:
'
'MUIM_Notify - Says this is a notification method. Always 1st.
'MUIA_Window_CloseRequest - Attribute of object to watch for changes.
'1 - Value to what for MUIA_Window_CloseRequest to change 1 (1=True in MUI)
'APP_OBJ - Object to send message to when MUIA_Window_Close request becomes 1
'2 - Number of parameters in the message
'
'Then the message that is send to APP_OBJ:
'
'MUIM_Application_ReturnID - This is a return value to AMOS Method
'MUIV_Application_ReturnID_Quit - The ID code number to return is quit (-1)
'
'MUIV_Application_ReturnID_Quit is a special paramter, which instead of
'being passed to _USER_RETURN_ID like every other value causes the mainloop
'to exit, which means the application is quit.
'
_COMPILE["MUIM_Notify,MUIA_Window_CloseRequest,1,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit"]
'
'The taglist above is sent to WIN_OBJ, as it is this objects close button
'we wish to monitor.
'
_MUI_DO_METHOD[WIN_OBJ,Param$]
'Setup the quit button to also quit the program
'The general format for these notifies is:
'
'MUIM_Notify, ATTRIBUTE, VALUE, SENDTO, NOPARAMS.
'
'I.E. Whenever the ATTRIBUTE specified of the object passed in _MUI_DO_METHODA
' changes to the VALUE specified , send the message in the rest of the list
' to the object in the SENDTO argument. NOPARAMS is the number of
' parameters in the rest of the list (The message).
'
'
'
_COMPILE["MUIM_Notify,MUIA_Pressed,0,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit"]
_MUI_DO_METHOD[BUT_QUIT_OBJ,Param$]
'
'Setup the 3 sound buttons to return values to _USER_RETURN_ID
'
_COMPILE["MUIM_Notify,MUIA_Pressed,0,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,1"]
_MUI_DO_METHOD[BUT_BELL_OBJ,Param$]
_COMPILE["MUIM_Notify,MUIA_Pressed,0,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,2"]
_MUI_DO_METHOD[BUT_SHOOT_OBJ,Param$]
_COMPILE["MUIM_Notify,MUIA_Pressed,0,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,3"]
_MUI_DO_METHOD[BUT_BOOM_OBJ,Param$]
'
'Setup return in the string gadget to return 4 to _USED_RETURN_ID
'
'NOTE: Use of MUIV_EveryTime for the value.
'
_COMPILE["MUIM_Notify,MUIA_String_Acknowledge,MUIV_EveryTime,"+ Fn ADR$(APP_OBJ)+"2,MUIM_Application_ReturnID,4"]
_MUI_DO_METHOD[FILE_OBJ,Param$]
'Now setup the order of tab-cycling for that gadgets
_COMPILE["MUIM_Window_SetCycleChain,"+ Fn ADR$(CYC_OBJ)+ Fn ADR$(CHK_OBJ)+ Fn ADR$(LIST_OBJ)+ Fn ADR$(FILE_OBJ)+ Fn ADR$(BUT_BELL_OBJ)+ Fn ADR$(BUT_SHOOT_OBJ)+ Fn ADR$(BUT_BOOM_OBJ)+ Fn ADR$(BUT_QUIT_OBJ)+"0"]
_MUI_DO_METHOD[WIN_OBJ,Param$]
'****************************************************************************
'This is the main part of the almost any MUI Program.
Fill Start(18) To Start(18)+Length(18),0 : Rem ensure all temporary strings are erased so you can see mistakes!
'Open the window
'
_MUI_SET_ATTRS[WIN_OBJ,"MUIA_Window_Open",1]
'Wait for user to quit. NOTE: Amiga-A is disabled because we are waiting
'on signals alot of the time - I.E. The AMOS process is suspended, and if
'the MUI screen is not accessable, the signals may never be sent, as they may
'come from user inputs, so you machine hangs!.
Bell
Print "Press A Key To Begin..."
Wait Key
Amos Lock
Amos To Back
_MUI_MAIN_LOOP[APP_OBJ]
Amos To Front
Amos Unlock
'Close the application. This gets rid off all objects, as long as they
'are children of the APP_OBJ. If they are other objects in existance,
'dispose of them here also.
'
'NOTE: You APP_OBJ must be called APP_OBJ as it is a shared variable
_MUI_CLOSE
'****************************************************************************
'Insert your programs termination tidy-up code here.
'
'
'for Intuiton extension users only...
'Iscreen Close 0
End
'****************************************************************************
'** Below is the MUI interface procedures. Open each to see what its for. **
'** These procedures do not require changing for other programs, except for**
'** _USER_RETURN_ID which needs re-coding each time. **
'****************************************************************************
'
'Taglist generator procedures
'
Procedure _COMPILE[A$]
Shared A1
'Compiles a TAG_LIST in a string, which may contain tag-equates
'& literal strings, and subnto a relocatable taglist string
'
A1=0 : OFF$="" : TAG$="" : ST$=""
Repeat
A=A1
Exit If A=Len(A$)
A1= Extension_16_00BC(A$,",",A) : If A1=0 : A1=Len(A$)+1 : End If
EL$=Mid$(A$,A+1,A1-A-1)
If(EL$="")
Print "Syntax error at position";A1+1
_MUI_CLOSE
End
Else If Asc(EL$)=39
'Quoted string
'
_GET_STRING[A$,A] : EL$=Param$
'Store formatted string
'
OFF$=OFF$+ Extension_16_04EA(Len(TAG$))+ Extension_16_04EA(Len(ST$))+ Extension_16_04EA(Len(EL$))
TAG$=TAG$+ Extension_16_04CE(0)
ST$=ST$+EL$
Inc A1
Else If Asc(EL$)=96
'Permanent String
'
_GET_STRING[A$,A] : EL$=Param$
OFF$=OFF$+ Extension_16_04EA(Len(TAG$))+ Extension_16_04EA(Len(ST$))+ Extension_16_04EA(-Len(EL$))
TAG$=TAG$+ Extension_16_04CE(0)
ST$=ST$+EL$
Inc A1
Else If Asc(EL$)=40
TAG$=TAG$+Mid$(A$,A+2,4)
A1=A+7
Else
'Numeric or Tag Equate value
V=Val(EL$)
If Str$(V)-" "<>EL$-" "
If Hex$(V)<>EL$-" "
_MATCH[EL$] : V=Param
Else
TAG$=TAG$+ Extension_16_04CE(V)
End If
End If
TAG$=TAG$+ Extension_16_04CE(V)
End If
Until A1>Len(A$)
'
End Proc[ Extension_16_04EA(Len(TAG$))+ Extension_16_04EA(Len(TAG$)+Len(ST$))+TAG$+ST$+OFF$+ Extension_16_04CE($80000000)]
Procedure _MATCH[TAG$]
If TAG$="TAG_DONE"
RES=0
Else
TREE=0
NODE$= Extension_16_0282(Start(13)+TREE+10,Deek(Start(13)+TREE+8))
While NODE$<>TAG$
If NODE$>TAG$
TREE=Deek(Start(13)+TREE)
Else
TREE=Deek(Start(13)+TREE+2)
End If
If TREE<>0
NODE$= Extension_16_0282(Start(13)+TREE+10,Deek(Start(13)+TREE+8))
Else
Print "Unknown tag ";TAG$;""
_MUI_CLOSE : End
End If
Wend
RES=Leek(Start(13)+TREE+4)
End If
End Proc[RES]
Procedure _STORE[S$]
Shared MUI_WORK_PTR
S$=S$+Chr$(0)
If Len(S$) mod 2
S$=S$+Chr$(0)
End If
If MUI_WORK_PTR+Len(S$)>Length(17)
Print "MUI Workspace Overflow"
_MUI_CLOSE : End
End If
_ADDR=Start(17)+MUI_WORK_PTR
Extension_16_02BE _ADDR,S$
Add MUI_WORK_PTR,Len(S$)
End Proc[_ADDR]
'Private procedures
'
Procedure _GET_STRING[A$,A]
Shared A1
A1=A+1
Repeat
A1= Extension_16_009E(A$,39,A1) : Exit If A1=0
Until Asc(Mid$(A$,A1-1,1))<>92
If A1=0
Print "Unmatched Quote at position ";A+1
_MUI_CLOSE : End
End If
EL$=Mid$(A$,A+2,A1-A-2)
'Substitute formatting codes
'
_FORMAT[EL$]
End Proc[Param$]
Procedure _FORMAT[EL$]
X= Extension_16_008C(EL$,92)
While X
Y=Asc(Mid$(EL$,X+1))
If Y=97
R$="'"
Else If Y=98
R$="`"
Else If Y=92
R$="\"
Else If Y=113
R$='"'
Else If Y=101
R$=Chr$(27)
Else If Y=116
R$=Chr$(9)
End If
EL$=Left$(EL$,X-1)+R$+Mid$(EL$,X+2)
X= Extension_16_009E(EL$,92,X)
Wend
'Pad string to even length & Null terminate
'
EL$=EL$+Chr$(0)
If Len(EL$) mod 2
EL$=EL$+Chr$(0)
End If
End Proc[EL$]
Procedure _INSTALL[TAG$]
'Takes a relocatable taglist string from compile, and returns a version
'usable in MUI Tag list calls, with all literal strings permanently stored
'in the MUI workspace.
'
Shared MUI_WORK_PTR
'If the taglist doesn't end with $80000000, it has already been ignored
'so don't re-install it.
'
If Extension_16_04DC(Right$(TAG$,4))=$80000000
MUI_TEMP_PTR=0
OFF=Deek(Varptr(TAG$)+2)+4
ST=Deek(Varptr(TAG$))+4
While OFF<Len(TAG$)-4
O=Deek(Varptr(TAG$)+OFF) : Add OFF,2
S=Deek(Varptr(TAG$)+OFF) : Add OFF,2
SL= Extension_16_035A(Deek(Varptr(TAG$)+OFF)) : Add OFF,2
P=Sgn(SL)
If P=-1
SL=-SL
B=17 : A=MUI_WORK_PTR
Add MUI_WORK_PTR,SL
Else
B=18 : A=MUI_TEMP_PTR
Add MUI_TEMP_PTR,SL
End If
If A+SL>Length(B)
Print "MUI Workspace / Tempspace overflow"
_MUI_CLOSE : End
End If
Loke Varptr(TAG$)+4+O,Start(B)+A
Copy Varptr(TAG$)+ST+S,Varptr(TAG$)+ST+S+SL To Start(B)+A
Wend
TAG$=Mid$(TAG$,5,Deek(Varptr(TAG$)))
End If
End Proc[TAG$]
'MUI Control Procedures
'
Procedure _MUI_NEW_OBJECT[NAME$,TAG_LIST$]
Shared _DEBUG
'Creates an MUI object from the given installed tag bank
'
_INSTALL[TAG_LIST$] : TAG_LIST$=Param$
If _DEBUG=1 Then Pop Proc[0]
NAME$=NAME$+Chr$(0)
Areg(0)=Varptr(NAME$)
If TAG_LIST$<>""
Areg(1)=Varptr(TAG_LIST$)
Else
Areg(1)=0
End If
End Proc[Lib Call(2,-$1E)]
Procedure _MUI_DISPOSE_OBJECT[OBJ]
'Disposes of an MUI Object & All of its child objects.
'
If OBJ
Areg(0)=OBJ
NULL=Lib Call(2,-$24)
End If
End Proc
Procedure _MUI_SET_ATTRS[OBJ,TAG$,V]
'Sets an MUI Objects attributes (Actually works for any BOOPSI object)
'
_MATCH[TAG$]
TAG_LIST$= Extension_16_04CE(Param)+ Extension_16_04CE(V)+ Extension_16_04CE(0)
If OBJ
Areg(0)=OBJ
Areg(1)=Varptr(TAG_LIST$)
NULL=Intcall(-648) : Rem SetAttrsA
End If
End Proc
Procedure _MUI_GET_ATTR[OBJ,TAG$]
'Gets an MUI Objects attributes (Actually works for any BOOPSI object)
'ONLY use for BOOLEAN/BYTE/INT/LONG attributes - NOT strings!
_MATCH[TAG$] : TAG=Param
V=0
If OBJ
Dreg(0)=TAG
Areg(0)=OBJ
Areg(1)=Varptr(V)
NULL=Intcall(-654) : Rem GetAttr
End If
End Proc[V]
Procedure _MUI_GET_STRING_ATTR[OBJ,TAG$]
'Gets a COPY of an MUI Objects string attribute.
'
_MUI_GET_ATTR[OBJ,TAG$]
End Proc[ Extension_16_0292(Param,65534,0)]
Procedure _MUI_DO_METHOD[OBJ,TAG_LIST$]
'A version of do_methodA hacked from amiga.lib via an E-Module!
'
If OBJ
_INSTALL[TAG_LIST$]
TAG_LIST$=Param$
Areg(2)=OBJ
Areg(0)=Leek(OBJ-4)
Areg(3)=Leek(Leek(OBJ-4)+8)
Areg(1)=Varptr(TAG_LIST$)
Call Leek(Leek(OBJ-4)+8)
End If
'
End Proc[Dreg(0)]
Procedure _MUI_MAIN_LOOP[APP_OBJ]
'
'This is the standard MUI wait for user input loop. This loop will
'terminate when the user quits the application by any valid quit
'method.
'
'Whenever an MUIM_Application_ReturnID event occurs, the procedure
'_USER_RETURN_ID is called with the ID returned. You should write
'this procedure to act on the ID's
'
SIGNAL=0
Do
'Do method application input & store MUI's signal bits in SIGNAL
TAGLIST$= Extension_16_04CE($8042D0F5)+ Extension_16_04CE(Varptr(SIGNAL))
Areg(2)=APP_OBJ
Areg(0)=Leek(APP_OBJ-4)
Areg(3)=Leek(Leek(APP_OBJ-4)+8)
Areg(1)=Varptr(TAGLIST$)
Call Leek(Leek(APP_OBJ-4)+8)
'
RES=Dreg(0)
If RES=-1
SIGNAL=0
_IS_ASL_OPEN
Exit If Param=0
End If
_USER_RETURN_ID[RES]
'
If SIGNAL<>0
Dreg(0)=SIGNAL
SIGNAL=Execall(-318) : Rem wait on signal
End If
Loop
End Proc
Procedure _MUI_REQUEST[APP_OBJ,WIN_OBJ,TITLE$,TEX$,BUT$]
'Pops up an MUI requester, centered on the window, if not NULL, with
'the title, TITLE$ unless it is null, in which case the application
'title is used. BUT$=" *_OK | _Save | _Cancel" etc. * = Default reply
'_ before a character sets the keyboard shortcut.
'TEX is the requester text.
'Returns number of button pressed. Numbers are from 1 upwards, but
'rightmost button is always 0.
'
_FORMAT[TEX$] : TEX$=Param$
F=Free
Dreg(0)=APP_OBJ
Dreg(1)=WIN_OBJ
Dreg(2)=0
If TITLE$="" Then Areg(0)=0 : Else Areg(0)=Varptr(TITLE$)
If TEX$="" Then Areg(2)=0 : Else Areg(2)=Varptr(TEX$)
If BUT$="" Then Areg(1)=0 : Else Areg(1)=Varptr(BUT$)
Areg(3)=0
End Proc[Lib Call(2,-$2A)]
Procedure _MUI_INIT[WORKSPACE,TEMPSPACE]
Shared MUI_WORK_PTR
Lib Open 2,"muimaster.library",8
Reserve As Work 17,WORKSPACE
Reserve As Work 18,TEMPSPACE
MUI_WORK_PTR=0
Lib Open 3,"intuition.library",0
Loke Start(14)+28, Extension_16_04C0(0) : Rem Store AMOS A5
Loke Start(14)+32,Lib Base(3) : Rem Store Intuition Base
Loke Start(14)+36,Lib Base(2) : Rem Store MUIMaster Base
Lib Close 3
End Proc
Procedure _MUI_CLOSE
Shared APP_OBJ
If APP_OBJ
_MUI_DISPOSE_OBJECT[APP_OBJ]
APP_OBJ=0
End If
Lib Close 2
Erase 17
Erase 18
Amos Unlock
Amos To Front
End Proc
Procedure _MUI_INSTALL_HOOK[ADR,D]
'Installs a hook to a assembler subroutine at address ADR. You should
'use an address in an AMOS bank - Ploadded banks are best.
'You are returned the address of the hook structure which you should put
'in the taglist which requies the hook. D a pointer to the data area
'associated with this instance of the hook. If you want several hook
'instances to share data, pass them the same value of D. If your hook
'requies no data, pass D=0
'
'NOTE: Each hook structure returned by this function should be used in
' a taglist only once. You can have many hooks to the same ADR.
'
'NOTE: MUI deallocates the hook structure's memory when parsing the
' taglist.
'
'For details on programming hooks, see the file Hook.s
'
'
Dreg(0)=24
Dreg(1)=0
HOOK=Execall(-198) : Rem _LVOAllocMem
If HOOK=0
Print "Failed to allocated hook memory"
_MUI_CLOSE
End
End If
Loke HOOK+8,Start(14)
Loke HOOK+12,ADR
Loke HOOK+16,D
End Proc[HOOK]
'MUI Builtin Object Creators / Macro creation procedures
'=======================================================
'Buttons
'
Procedure _MUIB_BUTTON[LABEL$]
'Create a simple button object
'
Dreg(0)=2 : Rem Button Object
_STORE[LABEL$] : A=Param
Areg(0)=Varptr(A)
End Proc[Lib Call(2,-120)]
Procedure _MUIB_KEYBUTTON[LABEL$,HOTKEY$]
HOTKEY$=Str$(Asc(HOTKEY$))-" "
_COMPILE["MUIA_Frame,MUIV_FrameButton,MUIA_Text_Contents,'\ec"+LABEL$+"',MUIA_Text_HiChar,"+HOTKEY$+",MUIA_ControlChar,"+HOTKEY$+",MUIA_InputMode,MUIV_InputModeRelVerify,MUIA_Background,MUII_ButtonBack,0"]
_MUI_NEW_OBJECT["Text.mui",Param$]
End Proc[Param]
Procedure _MUIB_POPBUTTON[IMAGE]
Dreg(0)=8
Areg(0)=Varptr(IMAGE)
End Proc[Lib Call(2,-120)]
Procedure _MUIB_CHECKMARK[LABEL$,HOTKEY$,SELECTED]
A$="MUIA_InputMode,MUIV_InputModeToggle,"
A$=A$+"MUIA_Image_Spec,MUII_CheckMark,"
A$=A$+"MUIA_Image_FreeVert,1,"
A$=A$+"MUIA_Selected,("+ Extension_16_04CE(SELECTED)+"),"
A$=A$+"MUIA_Background,MUII_ButtonBack,"
A$=A$+"MUIA_ControlChar,("+ Extension_16_04CE(Asc(HOTKEY$))+"),"
A$=A$+"MUIA_Frame,MUIV_FrameImageButton,"
A$=A$+"MUIA_ShowSelState,0,TAG_DONE"
_COMPILE[A$]
_MUI_NEW_OBJECT['Image.mui',Param$]
_MUIB_LABELOBJ["\el"+LABEL$,HOTKEY$,Param,True]
End Proc[Param]
'Labels
'
Procedure _MUIB_LABEL[LABEL$]
Dreg(0)=1 : Rem Label Object
A$=String$(Chr$(0),8)
Loke Varptr(A$),Varptr(LABEL$)
Areg(0)=Varptr(A$)
End Proc[Lib Call(2,-120)]
Procedure _MUIB_TITLE_LABEL[LABEL$]
_COMPILE["MUIA_Background,MUII_FILL,MUIA_Text_Contents,'\ec"+LABEL$+"',MUIA_Frame,MUIV_FrameGroup,TAG_DONE"]
_MUI_NEW_OBJECT["Text.mui",Param$]
End Proc[Param]
Procedure _MUIB_LABELOBJ[LABEL$,HOTKEY$,OBJ,RIGHT]
'Adds a label to the left of the object. The hotkey is the
'objects hotkey, which is underlined if it appears in the label.
'
'RIGHT=0 if label is fixed width on left of object (E.g. Strings)
'RIGHT=-1 if object is fixed/var width on left of var width label.
'Add Label...
_COMPILE["MUIA_Text_Contents,'\ec"+LABEL$+"',MUIA_Text_HiChar,"+Str$(Asc(HOTKEY$))-" "+",MUIA_Text_SetMax,("+ Extension_16_04CE(RIGHT+1)+"),TAG_DONE"]
_MUI_NEW_OBJECT["Text.mui",Param$] : LBOBJ=Param
If RIGHT
_MUIB_GROUP[ Extension_16_04CE(OBJ)+ Extension_16_04CE(LBOBJ),1,0]
Else
_MUIB_GROUP[ Extension_16_04CE(LBOBJ)+ Extension_16_04CE(OBJ),1,0]
End If
End Proc[Param]
'Strings
'
Procedure _MUIB_KEYSTRING[S$,MXLEN,HOTKEY$]
'NOTE: MXLEN is the real maximum length of the string, in terms of AMOS
' strings - don't add 1 for the terminating chr$(0) added by MUI.
Dreg(0)=7 : Rem String Object
HOTKEY$=Str$(Asc(HOTKEY$))-" "
S$=Left$(S$,MXLEN)+String$(Chr$(0),Max(0,MXLEN-Len(S$)))+Chr$(0)
_STORE[S$]
A$="MUIA_Frame,MUIV_FrameString,"
A$=A$+"MUIA_String_Contents,("+ Extension_16_04CE(Param)+"),"
A$=A$+"MUIA_String_MaxLen,("+ Extension_16_04CE(MXLEN+1)+"),"
A$=A$+"MUIA_ControlChar,"+HOTKEY$+",TAG_DONE"
_COMPILE[A$]
_MUI_NEW_OBJECT["String.mui",Param$]
End Proc[Param]
Procedure _MUIB_LABSTRING[S$,MXLEN,HOTKEY$,LABEL$]
'Even though this is a group object, you can still communicate
'with it as if it were a simple string object, as MUI objects pass
'unrecognised attributes down to their children.
_MUIB_KEYSTRING[S$,MXLEN,HOTKEY$]
_MUIB_LABELOBJ[LABEL$,HOTKEY$,Param,False]
End Proc[Param]
Procedure _MUIB_FILESTRING[LABEL$,HOTKEY$,INIT_FILE$,TITLE$]
'Create a string gadget with a button that pops up an ASL file requester.
'When the button is pressed, the string is changed to the selected file.
'
'Use notification on MUIM_String_Acknowledge to detect when the string
'changes.
_MUIB_LABSTRING[INIT_FILE$,256,HOTKEY$,LABEL$] : SOBJ=Param
_MATCH["MUII_PopFile"]
_MUIB_POPBUTTON[Param] : BTOBJ=Param
A$="MUIA_Popstring_String,("+ Extension_16_04CE(SOBJ)+"),"
A$=A$+"MUIA_Popstring_Button,("+ Extension_16_04CE(BTOBJ)+"),"
A$=A$+"ASLFR_TITLETEXT,'"+TITLE$+"',TAG_DONE"
_COMPILE[A$]
_MUI_NEW_OBJECT["Popasl.mui",Param$]
End Proc
Procedure _MUIB_LISTSTRING[S$,MXLEN,HOTKEY$,LABEL$,LOBJ]
'Parameters as _MUIB_LABSTRING, and LOBJ is a listview object -
'You can use those created by _MUIB_LISTVIEW
'
_MUIB_KEYSTRING[S$,MXLEN,HOTKEY$] : SOBJ=Param
'Get Intuition base for Get/Set Attr calls
'
_MUI_INSTALL_HOOK[Start(32),0] : OSHOOK=Param
_MUI_INSTALL_HOOK[Start(32)+4,0] : SOHOOK=Param
_MATCH["MUII_PopUp"]
_MUIB_POPBUTTON[Param] : BTOBJ=Param
A$="MUIA_Popstring_Button,("+ Extension_16_04CE(BTOBJ)+"),"
A$=A$+"MUIA_Popstring_String,("+ Extension_16_04CE(SOBJ)+"),"
A$=A$+"MUIA_Popobject_StrObjHook,("+ Extension_16_04CE(SOHOOK)+"),"
A$=A$+"MUIA_Popobject_ObjStrHook,("+ Extension_16_04CE(OSHOOK)+"),"
A$=A$+"MUIA_Popobject_Object,("+ Extension_16_04CE(LOBJ)+"),"
A$=A$+"TAG_DONE"
'
_COMPILE[A$]
_MUI_NEW_OBJECT['Popobject.mui',Param$] : POBJ=Param
_COMPILE["MUIM_Notify,MUIA_Listview_DoubleClick,1,("+ Extension_16_04CE(POBJ)+"),2,MUIM_Popstring_Close,1"]
_MUI_DO_METHOD[LOBJ,Param$]
_MUIB_LABELOBJ[LABEL$,HOTKEY$,POBJ,False]
End Proc[Param]
'Others
'
Procedure _MUIB_CYCLE[LIST$]
'Takes a list of labels for the cycle gadget, seperated by |'s. Labels
'may contain usual formatting codes.
OSEP=0 : PTR$=""
Repeat
SEP= Extension_16_009E(LIST$,124,OSEP) : If SEP=0 : SEP=Len(LIST$)+1 : End If
_FORMAT[Mid$(LIST$,OSEP+1,SEP-OSEP-1)]
_STORE[Param$] : PTR$=PTR$+ Extension_16_04CE(Param)
OSEP=SEP
Until SEP>Len(LIST$)
'Now PTR$ is an array of pointers to the labels
_STORE[PTR$+ Extension_16_04CE(0)] : PTR=Param
_COMPILE["MUIA_Cycle_Entries,("+ Extension_16_04CE(Param)+"),TAG_DONE"]
_MUI_NEW_OBJECT['Cycle.mui',Param$]
End Proc[Param]
Procedure _MUIB_LISTVIEW[LIST$]
'Create a listview from a string seperated with |'s.
'
_COMPILE["MUIA_Frame,MUIV_FrameInputList,TAG_DONE"]
_MUI_NEW_OBJECT['List.mui',Param$] : LOBJ=Param
OSEP=0 : PTR$=""
Repeat
SEP= Extension_16_009E(LIST$,124,OSEP) : If SEP=0 : SEP=Len(LIST$)+1 : End If
_FORMAT[Mid$(LIST$,OSEP+1,SEP-OSEP-1)]
_STORE[Param$]
_COMPILE["MUIM_List_InsertSingle,("+ Extension_16_04CE(Param)+"),MUIV_List_Insert_Bottom"]
_MUI_DO_METHOD[LOBJ,Param$]
OSEP=SEP
Until SEP>Len(LIST$)
'
_COMPILE["MUIA_Listview_List,("+ Extension_16_04CE(LOBJ)+"),TAG_DONE"]
_MUI_NEW_OBJECT['Listview.mui',Param$]
End Proc[Param]
Procedure _MUIB_BITMAP_BOB[_BOB,FRAME$]
'This procedure converts an AMOS Sprite bank image into an MUI bitmap
'object. _BOB is the image to convert. FRAME$ is an MUIV_Frame...
'tag to describe which frame to put around the image.
'
'NOTE: To not delete the sprite image while the MUI object is in use.
'
'NOTE: The image colours are remapped to the pens on the MUI objects
' screen which match the sprite palette closest.
'Compute Frame Tagvalue
'
_MATCH[FRAME$] : FRAME=Param
'Create a graphics library bitmap structure for the chosen bob image.
'
SB=Sprite Base(_BOB)
X=Deek(SB) : Y=Deek(SB+2) : D=Deek(SB+4)
PLN=SB+10
'
BITMAP$= Extension_16_04EA(X*2)+ Extension_16_04EA(Y)+ Extension_16_04EA(D)+ Extension_16_04EA(0)
For A=1 To 8
If A<=D
BITMAP$=BITMAP$+ Extension_16_04CE(PLN)
Add PLN,X*2*Y
Else
BITMAP$=BITMAP$+ Extension_16_04CE(0)
End If
Next
'
_STORE[BITMAP$] : BM=Param
'Create a 24 representation of the sprite palette for MUI to remap
'
NC=0 : Bset D,NC
SP=Start(1)+Deek(Start(1))*8+2 : SP$=""
For A=0 To NC-1
CL=Deek(SP+A*2)
R=(CL/$100)*$1111
G=((CL/$10) and $F)*$1111
B=(CL and $F)*$1111
SP$=SP$+ Extension_16_04EA(R)+ Extension_16_04EA(R)+ Extension_16_04EA(G)+ Extension_16_04EA(G)+ Extension_16_04EA(B)+ Extension_16_04EA(B)
Next
'
_STORE[SP$] : PAL=Param
'Create the bitmap object
'
A$="MUIA_Bitmap_Bitmap,("+ Extension_16_04CE(BM)+"),"
A$=A$+"MUIA_Bitmap_Width,("+ Extension_16_04CE(X*16)+"),"
A$=A$+"MUIA_Bitmap_Height,("+ Extension_16_04CE(Y)+"),"
A$=A$+"MUIA_FixWidth,("+ Extension_16_04CE(X*16)+"),"
A$=A$+"MUIA_FixHeight,("+ Extension_16_04CE(Y)+"),"
A$=A$+"MUIA_Bitmap_SourceColors,("+ Extension_16_04CE(PAL)+"),"
A$=A$+"MUIA_Frame,("+ Extension_16_04CE(FRAME)+"),"
A$=A$+"TAG_DONE"
_COMPILE[A$]
_MUI_NEW_OBJECT['Bitmap.mui',Param$]
End Proc[Param]
'Groups
Procedure _MUIB_SIZEABLE[OBJ,HORIZ]
'This procedure puts the object in a horizontal group
'with 2 empty rectanges, which effecively makes a fixwidth object
'resizeable. Usefull for _MUIB_BITMAP_BOB's which otherwise stop
'your window from being horizontally resized.
'
'If HORIZ is true, the object is made horizontally sizeable
'If HORIZ is false, the object is made vertically sizeable
'
'To make the object 2-way sizable, call this procedure twice.
'
'NOTE: The objects are given minimal weight so they are only
' expanded is little as possible to allow the window to
' resize, and anything else that is expandable will expand
' much more.
'
_MUI_NEW_OBJECT['Rectangle.mui',"MUIA_Weight,1,0"] : R1=Param
_MUI_NEW_OBJECT['Rectangle.mui',"MUIA_Weight,1,0"] : R2=Param
A$="MUIA_Group_Horiz,("+ Extension_16_04CE(-HORIZ)+"),"
A$=A$+"MUIA_Group_Child,("+ Extension_16_04CE(R1)+"),"
A$=A$+"MUIA_Group_Child,("+ Extension_16_04CE(OBJ)+"),"
A$=A$+"MUIA_Group_Child,("+ Extension_16_04CE(R2)+"),TAG_DONE"
_COMPILE[A$]
_MUI_NEW_OBJECT['Group.mui',Param$]
End Proc[Param]
Procedure _MUIB_GROUP[OBJ$,HORIZ,FRAME]
'
'Creates a group object.
'
'OBJ$ is a string of longword$ specifing the child objects
'
'HORIZ= 0/1 (1=Horizontal group)
'FRAME= 0/1 (1=Make a group frame)
_MATCH["MUIA_Group_Child"] : CH=Param
TAG$=""
For A=1 To Len(OBJ$)-3 Step 4
TAG$=TAG$+ Extension_16_04CE(CH)+Mid$(OBJ$,A,4)
Next
If HORIZ=1
_MATCH["MUIA_Group_Horiz"]
TAG$=TAG$+ Extension_16_04CE(Param)+ Extension_16_04CE(1)
End If
If FRAME=1
_MATCH["MUIA_Frame"]
TAG$=TAG$+ Extension_16_04CE(Param)
_MATCH["MUIV_FrameGroup"]
TAG$=TAG$+ Extension_16_04CE(Param)
End If
_MUI_NEW_OBJECT['Group.mui',TAG$+ Extension_16_04CE(0)]
End Proc[Param]
'****************************************************************************
'These procedures require modification.
'
Procedure _IS_ASL_OPEN
Shared FILE_OBJ
'This procedure is used to prevent your application from terminating
'while ASL requesters are still open.
'
'You should 'Or' _ASL_OPEN with the MUIA_Popasl_Active attribute
'or each of your PopAsl objects.
'
_ASL_OPEN=False
_MUI_GET_ATTR[FILE_OBJ,"MUIA_Popasl_Active"]
_ASL_OPEN=_ASL_OPEN or Param
End Proc[_ASL_OPEN]
Procedure _USER_RETURN_ID[ID]
'This procedure is called repeatedly when MUI is waiting for / receiving
'user input. ID values returned are those you specified in hook installs
'and MUIM_Application_ReturnID methods. There are also 2 built-in ID's:
'
'0 = No user input has occured. This procedure is called repeatedly with
' 0 when nothing is happening.
'
'-1 = This is MUI's quit signal. Normally if this ID is received,
' this procedure is not called, and the MUI_mainloop terminates
' returning to your main program, but if the user tries to quit
' while an ASL requester is open, the application can't quit, so
' this procedure is called with parameter -1.
'
'NOTE: You should return from this procedure within .5 seconds of it being
' called. If this is not possible, you should set the attribute
' MUIA_Application_Sleep to True of your APP_OBJ during the delay,
' then set it to false again just before returning.
Shared FILE_OBJ,APP_OBJ,WIN_OBJ
If ID=1
Bell
Else If ID=2
Shoot
Else If ID=3
Boom
Else If ID=4
_MUI_GET_STRING_ATTR[FILE_OBJ,"MUIA_String_Contents"]
_MUI_REQUEST[APP_OBJ,WIN_OBJ,"MUI Requester","String Gadget Contains : "+Param$+".","* _Ok | _So What? "]
Else If ID=-1
_MUI_REQUEST[APP_OBJ,0,"MUI Requester","You cannot quit while ASL requesters are open","* _Ok "]
End If
End Proc
'
'
'****************************************************************************
'The future
'==========
'
'
'This file was thrown together over 3 days, and is only the second program
'I have tried to write using MUI, and as such it is more an exploration of
'MUI's features on my part, than anything else.
'
'
'
'
'The allocation/deallocation of memory is not very advanced - I just store
'anything that needs keeping in a work bank, and forget about it. My eventual
'aim is to create Easylife commands/functions to aid MUI use:
'
' = Elmui New Object(TYPE$,TAG_LIST$)
'
'Which will take an AMOS taglist (I.E. As specified in the source), _COMPILE
'it, and _INSTALL it then create the object. But rather than putting the
'permanent strings in an AMOS work bank, this function would allocate some
'memory for permanent tag data, and store a pointer to it in MUIA_User_Data
'of the allocated object. The initial 2 longwords of this memory area would
'be left empty for the following:
'
'1st Longword. For Applications own use. (To replace _MUIA_User_Data)
'2nd Longword. Pointer to additional memory areas belonging to this object.
'
'
' = Elmui Dispose Object(OBJ)
'
'Which will dispose of the object, and of the MUI data areas pointed to
'by its _MUIA_User_Data field.
'
'
' = Elmui Get Attrs(OBJ,TAG$)
'
'Which will return the objects attribute specified in TAG$
'
'
' = Elmui Set Attrs(OBJ,TAG$,VALUE)
'
'Which will set the attribute, then return the values it was actually
'set to, so you tell if you succeeded (E.g. MUIA_Window_Open may fail)
'
'
' = Elmui Do Method(OBJ,TAG_LIST$)
'
'Which will do the method, but store any permanent data in the taglist
'in the memory allocated to ,and pointer to in a chain from longword #2
'of the memory area in _MUIA_User_Data, so that disposing of the object
'will also dispose of the data from the taglist.
'
'
'
'Each of the above funcitions would also have an equivilent which accepts
'a true taglist.
'
' = Elmui Store(OBJ,ADDR,LENGTH)
'
'Which will store a COPY of the memory area in the chain of additonal
'memory allocated to the object, for automatic disposal when the object
'is killed.
'
'
'I would also like the taglist parser to know which tags require permanent
'storage of their data, and which don't, and automatically allocated it
'if the data is passed as a literal string in the taglist. This could be
'done quite easily by storing a boolean in BANK 13 with each tag. The only
'problem is knowing which tags need permanent storage. Any help in compiling
'a list would be greatly appreciated. (Just E-Mail me tagnames, and YES/NO)
'
'
'Something I an in the process of doing now, is to allow AMOS Procedures
'to be hook functions, so you don't have to write them in assembler,
'(although it is worth doing so if you can, as they are much faster)
'
'
'If you would like to help develop an AMOS interface to MUI I would like the
'following:
'
'
' - Any of the above function calls coded in assembler :-)
'
' - More assembler hook routines in banks for various purposes
' (Preferably with source).
'
' - More MUIB object building procedures.
'
' - Any useful MUI External classes you may happen to have.
'
' - Example applications.
'
' - Suggestions for other MUI Easylife Functions / AMOS Procedures.
' (Or non-MUI easylife functions for that matter)
'
' - Bug reports.
'
'
'
'
'Known Bugs
'==========
'
'When you manually type an entry into a LISTSTRING (Such as Check: in the
'demo), then popup the list, the list is searched for the string and the
'intial active/highlighted entry is set to it if it is found, otherwise
'there is no highlighted entry. The hook function finds the entry in the
'list OK, but when it sets the lists the _MUIA_List_Active attribute, nothing
'happens - the highlight doesn't move. A Prize for anyone who can find out
'why (See source Listview-Hooks.s)
'